package manong.beans;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;

public class Teaching implements Cloneable, Serializable {
   
    private Integer id;
    private Integer classId;
    private Integer teacherId;
    private Integer semId;
    private String className;
    private String techerName;
    private String sign;
    private Integer statu;
    private String mark;

    private static final long serialVersionUID = 1L;

     public Teaching(Integer id, Integer classId, Integer teacherId, Integer semId, String className, String techerName, String sign, Integer statu, String mark) {
        this.id = id;
        this.classId = classId;
        this.teacherId = teacherId;
        this.semId = semId;
        this.className = className;
        this.techerName = techerName;
        this.sign = sign;
        this.statu = statu;
        this.mark = mark;
    }

 
    public Teaching() {
        super();
    }

  
    public Integer getId() {
        return id;
    }

    
    public Teaching withId(Integer id) {
        this.setId(id);
        return this;
    }


    public void setId(Integer id) {
        this.id = id;
    }


    public Integer getClassId() {
        return classId;
    }

   
    public Teaching withClassId(Integer classId) {
        this.setClassId(classId);
        return this;
    }

    public void setClassId(Integer classId) {
        this.classId = classId;
    }


    public Integer getTeacherId() {
        return teacherId;
    }


    public Teaching withTeacherId(Integer teacherId) {
        this.setTeacherId(teacherId);
        return this;
    }

 
    public void setTeacherId(Integer teacherId) {
        this.teacherId = teacherId;
    }

 
    public Integer getSemId() {
        return semId;
    }

 
    public Teaching withSemId(Integer semId) {
        this.setSemId(semId);
        return this;
    }

  
    public void setSemId(Integer semId) {
        this.semId = semId;
    }

 
    public String getClassName() {
        return className;
    }

 
    public Teaching withClassName(String className) {
        this.setClassName(className);
        return this;
    }

   
    public void setClassName(String className) {
        this.className = className;
    }

  
    public String getTecherName() {
        return techerName;
    }

  
    public Teaching withTecherName(String techerName) {
        this.setTecherName(techerName);
        return this;
    }

  
    public void setTecherName(String techerName) {
        this.techerName = techerName;
    }

  
    public String getSign() {
        return sign;
    }

    
    public Teaching withSign(String sign) {
        this.setSign(sign);
        return this;
    }

  
    public void setSign(String sign) {
        this.sign = sign;
    }

    public Integer getStatu() {
        return statu;
    }

  
    public Teaching withStatu(Integer statu) {
        this.setStatu(statu);
        return this;
    }


    public void setStatu(Integer statu) {
        this.statu = statu;
    }

  
    public String getMark() {
        return mark;
    }


    public Teaching withMark(String mark) {
        this.setMark(mark);
        return this;
    }

 
    public void setMark(String mark) {
        this.mark = mark;
    }

   
    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Teaching other = (Teaching) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getClassId() == null ? other.getClassId() == null : this.getClassId().equals(other.getClassId()))
            && (this.getTeacherId() == null ? other.getTeacherId() == null : this.getTeacherId().equals(other.getTeacherId()))
            && (this.getSemId() == null ? other.getSemId() == null : this.getSemId().equals(other.getSemId()))
            && (this.getClassName() == null ? other.getClassName() == null : this.getClassName().equals(other.getClassName()))
            && (this.getTecherName() == null ? other.getTecherName() == null : this.getTecherName().equals(other.getTecherName()))
            && (this.getSign() == null ? other.getSign() == null : this.getSign().equals(other.getSign()))
            && (this.getStatu() == null ? other.getStatu() == null : this.getStatu().equals(other.getStatu()))
            && (this.getMark() == null ? other.getMark() == null : this.getMark().equals(other.getMark()));
    }

   
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getClassId() == null) ? 0 : getClassId().hashCode());
        result = prime * result + ((getTeacherId() == null) ? 0 : getTeacherId().hashCode());
        result = prime * result + ((getSemId() == null) ? 0 : getSemId().hashCode());
        result = prime * result + ((getClassName() == null) ? 0 : getClassName().hashCode());
        result = prime * result + ((getTecherName() == null) ? 0 : getTecherName().hashCode());
        result = prime * result + ((getSign() == null) ? 0 : getSign().hashCode());
        result = prime * result + ((getStatu() == null) ? 0 : getStatu().hashCode());
        result = prime * result + ((getMark() == null) ? 0 : getMark().hashCode());
        return result;
    }


    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", classId=").append(classId);
        sb.append(", teacherId=").append(teacherId);
        sb.append(", semId=").append(semId);
        sb.append(", className=").append(className);
        sb.append(", techerName=").append(techerName);
        sb.append(", sign=").append(sign);
        sb.append(", statu=").append(statu);
        sb.append(", mark=").append(mark);
        sb.append("]");
        return sb.toString();
    }


    @Override
    public Teaching clone() throws CloneNotSupportedException {
        return (Teaching) super.clone();
    }

  
    public enum Column {
        id("id", "id", "INTEGER", false),
        classId("class_id", "classId", "INTEGER", false),
        teacherId("teacher_id", "teacherId", "INTEGER", false),
        semId("sem_id", "semId", "INTEGER", false),
        className("class_name", "className", "VARCHAR", false),
        techerName("techer_name", "techerName", "VARCHAR", false),
        sign("sign", "sign", "VARCHAR", false),
        statu("statu", "statu", "INTEGER", false),
        mark("mark", "mark", "VARCHAR", false);

    
        private static final String BEGINNING_DELIMITER = "`";

    
        private static final String ENDING_DELIMITER = "`";

     
        private final String column;

     
        private final boolean isColumnNameDelimited;

       
        private final String javaProperty;

    
        private final String jdbcType;

     
        public String value() {
            return this.column;
        }

        public String getValue() {
            return this.column;
        }

        public String getJavaProperty() {
            return this.javaProperty;
        }

        public String getJdbcType() {
            return this.jdbcType;
        }

        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

  
        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }
    }
}